﻿@model SelfMadeMillionaire.Web.Infrastructure.ViewModels.MailingList.UnsubscribeViewModel
@{
	ViewBag.Title = "Unsubscribe";
	Layout = "~/Views/Shared/_Layout.cshtml";
}


@using (Html.BeginForm("UnSubscribe", "MailingList", FormMethod.Post, new { @class = "form-horizontal" }))
{

	@Html.ValidationSummary()

	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="50%">
				<div class="form-group">
					@Html.LabelFor(m => m.Email, new { @class = "col-sm-3 control-label custom_label" })
					<div class="col-sm-7">
						@Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder = "Enter your first name", tabindex=1 })
					</div>
				</div>
			</td>
			<td width="50%">
				<div class="form-group">
					<div class="col-sm-10">
						<div class="checkbox">
							<label class="custom_label">
								@Html.CheckBoxFor(m => m.IsSMM, new { tabindex=2 }) Self-Made Millionaire Newsletter									 
							</label>
						</div>
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
				<div class="form-group">
					<div class="col-sm-10">
						<div class="checkbox">
							<label class="custom_label">
								@Html.CheckBoxFor(m => m.IsMMM, new { tabindex=3 }) Maggie's Money Mountain Newsletter
							</label>
						</div>
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<div class="newsletter_search_btn">
					<button type="submit" class="btn btn-primary" tabindex="4">Unsubscribe</button>
				</div>
			</td>
		</tr>

	</table>
	
	if (Model.IsSuccess)
	{
	<div class="modal fade" id="success-dialog" tabindex="-1" role="dialog" aria-labelledby="add-dialog-label" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">

					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="success-dialog-label">Unsubscribing</h4>
					</div>
					<div class="modal-body">
						Thank you for unsubscribing.
					</div>
					<div class="modal-footer">
						<div class="row">
							<div class="col-sm-12">
								<div class="pull-right">
									<a href="#" class="btn btn-default width80" data-dismiss="modal">OK</a>
								</div>
							</div>
						</div>

					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
			</div>
		</div>
	<script type="text/javascript">
		$(function () {
			$("#success-dialog").modal();
			$("input[type='text']").val('');
		});
	</script>
	}

}
